// Xampler, a MIDI-driven sampler
// Copyright (C) 2006 Nick Thomas
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 USA.

#ifndef XAMPLER_MENU_BAR_HPP
#define XAMPLER_MENU_BAR_HPP

// Encapsulates the UIManager and associated objects.

#include <gtkmm/uimanager.h>

namespace xampler
{
    class MenuBar
    {
    public:
        MenuBar();
        Gtk::Widget *get_menu_bar()
            { return m_ui_manager->get_widget("/MenuBar"); }
        Glib::RefPtr<Gtk::AccelGroup> get_accel_group()
            { return m_ui_manager->get_accel_group(); }
        Glib::SignalProxy0<void> signal_about()
            { return m_action_group->get_action("About")->signal_activate(); }
        Glib::SignalProxy0<void> signal_quit()
            { return m_action_group->get_action("Quit")->signal_activate(); }
        Glib::SignalProxy0<void> signal_new()
            { return m_action_group->get_action("New")->signal_activate(); }
        Glib::SignalProxy0<void> signal_open()
            { return m_action_group->get_action("Open")->signal_activate(); }
        Glib::SignalProxy0<void> signal_revert()
            { return m_action_group->get_action("Revert")->
                  signal_activate(); }
        Glib::SignalProxy0<void> signal_save()
            { return m_action_group->get_action("Save")->signal_activate(); }
        Glib::SignalProxy0<void> signal_save_as()
            { return m_action_group->get_action("SaveAs")->
                  signal_activate(); }

    private:
        Glib::RefPtr<Gtk::UIManager> m_ui_manager;
        Glib::RefPtr<Gtk::ActionGroup> m_action_group;
    };
}

#endif
